package com.imagine.common;

import com.imagine.service.DelegationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * Created by liangyue on 2017/9/27.
 * Description:当系统全部加载完spring组件后，初始化委托未成交信息(Global.securityDealInfo)
 */
@Component
public class InstantiationTracingBeanPostProcessor implements ApplicationListener<ContextRefreshedEvent> {
    @Autowired
    DelegationService delegationService;
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
//需要执行的逻辑代码，当spring容器初始化完成后就会执行该方法。
        System.out.println("#######################################################3");
        delegationService.initSecurityDealInfo();
    }
}